package com.jichangxiu.common.constant;

public class RedisConstants {

    public static String createNo(String projectName, String tenantId, String type, String time) {
        return projectName.toUpperCase() + ":REDIS_NO:" + tenantId.toUpperCase() + ":" + type.toUpperCase() + "_NO:" + time + ":";
    }

    public static String createRequestRepeatKey(String projectName, String url, String jti) {
        return projectName.toUpperCase() + ":REQUEST_INFO:RATE_REPEAT:" + url.toUpperCase() + ":" + jti.toUpperCase() + ":";
    }

    public static String createRequestLimitKey(String projectName, String ip) {
        return projectName.toUpperCase() + ":REQUEST_INFO:RATE_LIMIT:" + ip.toUpperCase() + ":";
    }

    public static String createJwtToRedisOfKey(String projectName, String jti) {
        return projectName.toUpperCase() + ":LOGIN_INFO:JWT_LIST:" + jti.toUpperCase() + ":";
    }

    public static String createJtiToRedisOfKey(String projectName, String tenantId, String userId) {
        return projectName.toUpperCase() + ":LOGIN_INFO:JTI_LIST:" + tenantId.toUpperCase() + ":" + userId.toUpperCase() + ":";
    }

}
